﻿
namespace Chess
{
    public class Tile : IReadOnlyTile
    {
        private readonly Position position;
        private Piece piece;
        private bool pieceHasChanged = false;

        public Tile(Position position, Piece piece = null)
        {
            this.position = position;
            this.piece = piece;
        }
        public Tile(IReadOnlyTile tile)
        {
            this.position = tile.Position;
            this.piece = tile.Piece;
            this.pieceHasChanged = tile.PieceHasChanged;
        }

        public Position Position { get { return position; } }
        public Piece Piece { get { return piece; } set { piece = value; pieceHasChanged = true; } }
        public bool PieceHasChanged { get { return pieceHasChanged; } }
    }
}